package com.hunting.resume;



import java.util.List;

import org.hibernate.Query;
import org.hibernate.classic.Session;




import util.dao.HibernateDaoImpl;


public class ResumeDaoImpl extends HibernateDaoImpl<Resume, Long> implements ResumeDao {

	@Override
	public Resume findByuserid(Long user_id) {
	   Session session = (Session) getSession(); 
		Query query = session.createQuery("from " +Resume.class.getName()+" where user_id = "+user_id);
		return (Resume)query.uniqueResult();
//		Query query = (Query) this.getHibernateTemplate().find("from "+Resume.class.getName()+" where user_id = "+user_id);
//		return (Resume) query.uniqueResult();
	}

	@Override
	public List<Resume> findByuserId(Long user_id) {
		Session session = (Session) getSession();
		Query query = session.createQuery("from "+Resume.class.getName()+" where user_id = "+user_id);
		return query.list();
	}

	
	

	
	

	

}
